<include file="Public:header" />
<div class="container">
  <div class="mainbody"> <include file="Public:redmenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>红包列表</h2>
         <p class="text-right function"> <a href="__URL__/redadd?sid={$_GET['sid']}" class="btn btn-info btn-sm" title="添加红包"><span class="glyphicon glyphicon-plus"></span> 添加红包</a> </p>
      </div>
      <div class="detail">
        <div id="tabCot_product_1" class="tabCot" >
          <table cellspacing="0" cellpadding="0" width="100%" border="0" class="tabindex table-hover">
            <tbody>
              <tr>
                <th>红包编号</th>
                <th>红包奖项</th>
                <th>红包内容</th>
				<th>总数量</th>
                <th>剩余数量</th>
                <th>已中奖数量</th>
                <th>中奖概率</th>
                <th>红包状态</th>
                <th>操作</th>
              </tr>
              <volist name="list" id="vo" key="key">
                <tr>
                  <td>{$vo.id}</td>
                  <td>{$vo.praisename}</td>
                  <td>{$vo.praisecontent} </td>
				  <td class="order40">{$vo.praisetotal}</td>
                  <td class="order20">{$vo.praisenumber}</td>
                  <td class="order30">{$vo['praisetotal']-$vo['praisenumber']}</td>
                  <td class="order10">{$vo.chance}</td>
                  <td><if condition="$vo.status eq 1"><font style="color:red">不可用</font><else/><font style="color:#093">正常</font></if></td>
                  <td>
                  <a href="__URL__/redadd?id={$vo.id}" title="编辑">编辑</a>&nbsp;|&nbsp;
                  <if condition="$vo.status eq 2">
                  <a href="javascript:confirmDelete({$vo.id},'确定删除吗?',1,{$vo.sid});" title="删除">删除</a>
                  <else/>
                   <a href="javascript:confirmDelete({$vo.id},'确定恢复吗?',2,{$vo.sid});" title="恢复">恢复</a>
                   </if>
                   &nbsp;|&nbsp;
                  <a href="__URL__/seeorder?id={$vo.id}&sid={$vo.sid}" title="拒绝申请">查看中奖人员</a></td>
                </tr>
              </volist>
             <notempty name="list">
               <tr style="font-weight:bold">
              
                <td>总计</td>
                <td ></td>
               <!-- <td id="resiger1"></td>
                <td id="resiger2"></td>-->
                <td ></td>
                <td id="order40"></td>
                <td id="order20"></td>
                <td id="order30"></td>
                <td id="order10"></td>
                <td ></td>
                <td ></td>
              </tr>
              </notempty>
            </tbody>
          </table>
          <div class="manu"> {$page} </div>
        </div>
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" /> 
<script type="text/javascript">
$(function(){
	$('#redindex').addClass('rig_seleli');
	$("tr:odd").addClass("even");
	$("tr:even").addClass("odd");
	
	var resiger=0,ordercount=0,order40=0,order30=0,order20=0,order10=0;
		for(var i=0;i<$(".resiger").length;i++){
			resiger += parseFloat($(".resiger").get(i).innerHTML);
		}
		for(var i=0;i<$(".ordercount").length;i++){
			ordercount += parseFloat($(".ordercount").get(i).innerHTML);
		}
		for(var i=0;i<$(".order40").length;i++){
			order40 += parseFloat($(".order40").get(i).innerHTML);
		}
		for(var i=0;i<$(".order20").length;i++){
			order20 += parseFloat($(".order20").get(i).innerHTML);
		}
		for(var i=0;i<$(".order30").length;i++){
			order30 += parseFloat($(".order30").get(i).innerHTML);
		}
		for(var i=0;i<$(".order10").length;i++){
			order10 += parseFloat($(".order10").get(i).innerHTML);
		}
		$("#resiger").html(resiger);
		$("#ordercount").html(ordercount);
		$("#order40").html(order40);
		$("#order20").html(order20);
		$("#order30").html(order30);
		$("#order10").html(order10);
});

function changeSelect() {
	var keys = $('#keys').val();
    location.href = "__URL__/index?keys=" + keys;
}

function confirmDelete(id,title,status,sid){
	if (confirm(title)) {
       location.href="__URL__/delered?id="+id+'&status='+status+'&sid='+sid;
    }
}


</script>